<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>内部工作信息处理平台（OA）</title>
    <link rel="stylesheet" type="text/css" href="css/ext-all.css" />
    <script language="javascript" type="text/javascript" src="js/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="js/ext-jquery-adapter.js"></script>
    <script language="javascript" type="text/javascript" src="js/ext-all-debug.js"></script>
    <script language="javascript" type="text/javascript" src="js/ext-lang-zh_CN.js"></script>
 	<style>
	</style>
</head>
<body>
<script language="javascript" type="text/javascript">
var bigw=new Array();
var i7_error;
var i7=i7_sys={
	wmanager:{
		bigw:bigw	
	},
	loadjs:function(urls){
		Ext.Ajax.request({
			url:urls,
			method:'GET'
		});
		Ext.Ajax.on('requestcomplete',function(conn,xmlhttp,opts){
			try{
				eval(xmlhttp.responseText);
			}
			catch(e){
				i7_error=e;
				Ext.Msg.alert('系统远程代码错误','代码地址：'+urls+'<br />出错信息：'+e.toString());
			}
			finally{
			}
		});
		
	}
};
var cwidth,cheight
var xxgg,newsdata,newsgrid;
bigw.removeid=function(v){
	if(v){
		var i;
		delete this[v].bigi;
		for(i=v;i<this.length;i++)
			this[i]=this[i+1];
		this.pop();
		if(this.length>0){
			this[this.length-1].setHeight(Ext.get('maincontent').getHeight());
			this[this.length-1].setWidth(Ext.get('maincontent').getWidth());
			this[this.length-1].setPosition(0,38);
		};
	};
}
bigw.add=function(w){
	this.push(w);
	if(this.length>0){
		this[this.length-1].setHeight(Ext.get('maincontent').getHeight());
		this[this.length-1].setWidth(Ext.get('maincontent').getWidth());
		this[this.length-1].setPosition(0,38);
	};
	return this.length-1;
}
function xxggshow(){
	if(!xxgg){
		var xxgg=new Ext.Window({
			title:'信息公告',
			modal:false,
			width:600,
			height:400,
			resizable:true,
			maximizable:true,
			minimizable:true,
			closeAction:'hide',
			layout:'anchor',
			animateTarget:Ext.get('i7_start'),
			animCollapse:true,
			listeners:{  
				beforehide :function(w){  
				//关键部分：关闭窗口前先还原,滚动条才不会消失  
					bigw.removeid(w.bigi);
				},  
				minimize:function(w){ 
					w.minimized=true;
					w.hide();
				},  
				maximize:function(w){      
				//关键部分：最大化后需要将窗口重新定位，否则窗口会从最顶端开始最大化                          
					w.bigi=bigw.add(w);
				},
				restore:function(w){
					bigw.removeid(w.bigi);
				}
			 }  
		});
		newsdata=new Ext.data.Store({
			proxy:new Ext.data.HttpProxy({url:'newsdata.asp'}),
			reader:new Ext.data.JsonReader({totalProperty:'count',root:'contents'},new Ext.data.Record.create([
				{name:'id'},
				{name:'title'},
				{name:'litcontent'},
				{name:'content'},
				{name:'count'},
				{name:'ctime'},
				{name:'user_id'},
				{name:'partment'},
				{name:'username'},
			]))
		});
		newsgrid=new Ext.grid.GridPanel({
			store:newsdata,
			anchor:'100% 100%',
			layout:'fit',
			//autoExpandColumn:'1',
			columns:[
				{header:'标题',dataIndex:'title',width:60},
				{header:'部门',dataIndex:'partment',width:10},
				{header:'发表人',dataIndex:'username',width:10},
				{header:'阅读次数',dataIndex:'count',width:8},
				{header:'发表时间',dataIndex:'ctime',width:12}
			],
			viewConfig:{
				forceFit:true	
			}
			
		});
		xxgg.add(newsgrid);
	};
	xxgg.show();
}
var dwtxl,dwtxlgrid,dwtxlstore;
function dwtxlshow(){
	if(!dwtxl){
		dwtxl=new Ext.Window({
			title:'单位内部通讯录',
			modal:false,
			width:600,
			height:400,
			resizable:true,
			maximizable:true,
			closeAction:'hide',
			layout:'anchor',
			listeners:{  
				beforehide:function(w){  
				//关键部分：关闭窗口前先还原,滚动条才不会消失  
					bigw.removeid(w.bigi);
					
				},  
				maximize:function(w){      
				//关键部分：最大化后需要将窗口重新定位，否则窗口会从最顶端开始最大化                          
					w.bigi=bigw.add(w);
				},
				restore:function(w){
					bigw.removeid(w.bigi);
				}
			 }  
		});
		dwtxlstore=new Ext.data.Store({
			proxy:new Ext.data.HttpProxy({url:'dwtxl.asp'}),
			reader:new Ext.data.JsonReader({totalProperty:'count',root:'contents'},new Ext.data.Record.create([
				{name:'id'},
				{name:'title'},
				{name:'litcontent'},
				{name:'content'},
				{name:'count'},
				{name:'ctime'},
				{name:'user_id'},
				{name:'partment'},
				{name:'username'},
			]))
		});
	};
	dwtxl.show();
};	
var mm1=new Ext.menu.Menu({
	id:'tmm1',
	items:[{
		text:'信息公告',
		style:'font-size:14px;',
		handler:function(){
			xxggshow();
			newsdata.load({page:1});
		}
		},{
		text:'事务处理',
		style:'font-size:14px;',
		handler:function(){}
		},{
		text:'个人公开',
		style:'font-size:14px;',
		handler:function(){}
		},{
		text:'通讯录',
		style:'font-size:14px;',
		handler:function(){
			dwtxlshow();
		}
	}]
});
var mm2=new Ext.menu.Menu({
	id:'tmm2',
	items:[
		{
		text:'内部信息',
		style:'font-size:14px;',
		handler:function(){}
		},{
		text:'资源共享',
		style:'font-size:14px;',
		handler:function(){}
		}
	]
});
var settingm=new Ext.menu.Menu({
	id:'setting',
	items:[
		{
		text:'修改联系方式',
		style:'font-size:14px;',
		handler:function(){}
		},{
		text:'密码修改',
		style:'font-size:14px;',
		handler:function(){}
		}
	]
});
Ext.onReady(function(){
	new Ext.Viewport({
		layout:'border',
		items:[
			{
			xtype:'toolbar',
			id:'topmenu',
			region:'north',
			height:38,
			items:[
				{
				xtype: 'tbtext',
				id:'logo',
				text:'&nbsp;&nbsp;<span style=\'font-size:16px;line-height:12px;color:red;font-weight:600;\'>气象局内部OA平台</span>',	
				width:160
				},{
				xtype: 'tbbutton',
				text:'<span style=\'font-size:16px;line-height:12px;\'>日常工作</span>',
				height:30,
				width:90,
				menu:mm1
				},{
				xtype: 'tbbutton',
				text:'<span style=\'font-size:16px;line-height:14px;\'>工作交流</span>',
				height:30,
				width:90,
				menu:mm2
				},{
				xtype: 'tbbutton',
				text:'<span style=\'font-size:16px;line-height:14px;\'>系统设置</span>',
				height:30,
				width:90,
				menu:settingm
				},{
				xtype: 'tbbutton',
				text:'<span style=\'font-size:16px;line-height:14px;\'>退出</span>',
				height:30,
				width:90,
				style:'float:right'
				}	   
			]
			},{
			xtype:'panel',
			id:'maincontent',
			region:'center',
			html:'<div id=\"workplace\" style=\"width:100%;\">这个是主要内容区域<div>'
			},
			{
			xtype:'toolbar',
			id:'buttommenu',
			region:'south',
			height:30,
			style:'z-index::11000;',
			items:[{
				id:'i7_start',
				xtype:'tbtext',
				text:'<span style=\'font-size:16px;\'>开始</span>'
				   }]
			}
		]
	});
	Ext.get('maincontent').on('resize',function(){
		if(bigw.length){
			bigw[bigw.length-1].setHeight(Ext.get('maincontent').getHeight());
			bigw[bigw.length-1].setWidth(Ext.get('maincontent').getWidth());
			bigw[bigw.length-1].setPosition(0,38);
		};
	});
}
);
</script>

</body>
</html>
